package org.javia.kaleidoscope;

import android.app.Activity;
import android.os.Bundle;
import android.hardware.SensorManager;
import android.content.Context;
import android.util.Log;

public class Kaleidoscope extends Activity
{
    SensorManager manager;
    KaleidoscopeView view;

    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(view = new KaleidoscopeView(this));
	manager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
    }

    protected void onResume() {
	super.onResume();
	manager.registerListener(view, manager.getDefaultSensor(SensorManager.SENSOR_ORIENTATION), SensorManager.SENSOR_DELAY_GAME);
    }

    protected void onPause() {
	super.onPause();
	manager.unregisterListener(view);
    }
}
